<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@page import="com.systop.ltbook.BookConstants, com.systop.ltbook.webapp.tiku.TkConstants, java.util.Map, java.util.List, com.systop.cms.model.Articles, com.systop.cms.model.Catalogs" %>
<%@ include file="/common/taglibs.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
  <%@ include file="/common/taglibs.jsp"%>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <title>中国校校通</title>
  <%@include file="/pages/new/resources.jsp" %>
  <style type="text/css">
  	.tktitle{
  		text-align: center;
  		font-size: 13px;
  		height: 25px;
  		font-weight: bold;
  		line-height: 25px;
  		background-image: url("${ctx}/images/lt_new/tt_bg.gif");
  	}
  	.tkdiv{
  		width: 236px;
  		height: 30px;
  		line-height: 30px;
  	}
  	.grade{
  		margin-top:10px;
  		padding-left: 10px;
  		width:595px;
  		height: 25px;
  		line-height: 25px;
  		font-weight: bold;
  		border-bottom: 1px dotted #C0C0C0;
  	}
  	.tkart{
  		margin: 5px 5px;
  		width: 275px;
  		height:25px;
  		line-height:25px;
		float: left;
  		white-space:nowrap;
		word-break:keep-all;
		overflow:hidden;
		text-overflow:ellipsis;
  	}
  	
  </style>
</head>
<body>
<%@include file="/pages/new/index_top.jsp" %>
<%@include file="/pages/new/index_search.jsp" %>
<%
	Map<String, Object> data = (Map<String, Object>)request.getAttribute("data");
%>
<table width="1002" height="40" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td background="${ctx}/images/lt_new/class_t_bg.gif">
      <table width="1002" height="40" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td width="111" align="center" style="color: #000;">
            <s:if test="#attr.data.catalog != null">
	      		<b>${data.catalog.name}</b>
	      	</s:if>
          </td>
          <td width="890" align="right" style="padding-right:40px;">
            &nbsp;&nbsp;<a href="${ctx}/tiku/index.do?rootPath=/jxtk/xxtk">小学题库</a>&nbsp;&nbsp;
            &nbsp;&nbsp;<a href="${ctx}/tiku/index.do?rootPath=/jxtk/cztk">初中题库</a>&nbsp;&nbsp;
            &nbsp;&nbsp;<a href="${ctx}/tiku/index.do?rootPath=/jxtk/gztk">高中题库</a>&nbsp;&nbsp;
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table width="990" height="500" align="center" cellpadding="0" cellspacing="0" style="border:1px solid #E6E6E6;">
  <tr>
  	<td width="595" valign="top" style="border-right:1px solid #E6E6E6;"> 
  	  <div class="tktitle">
  	  	<s:if test="#attr.data.left != null">
	  	  <a href="${ctx}/ltcata/catalog.do?path=${data.left.rootPath}" target="_blank">${data.left.name}</a>
  	  	</s:if>
  	  </div>
  	  <div style="">
  	  	<%
  	  		String gradeName = null;
  	  		for (String grade : TkConstants.GRADES) {
  	  			gradeName = BookConstants.GRADE_NAME_MAP.get(grade);
  	  			List<Articles> arts = (List<Articles>)data.get(grade);
  	  			  if (arts != null && !arts.isEmpty()){
		  	  		StringBuffer gradeHtml = new StringBuffer();
		  	  		gradeHtml.append("<div class='grade'>").append(gradeName).append("</div>");
	  	  	    	out.println(gradeHtml.toString());
	  	  	    	for(Articles art : arts){
	  	  	    		StringBuffer artHtml = new StringBuffer();
	  	  	    		artHtml.append("<div class='tkart'><a target='_blank' href='../ltart/view.do?model.id=").append(art.getId());
	  	  	    		artHtml.append("' title='").append(art.getShortTitle()).append("'><b>．</b>");
	  	  	    		artHtml.append(art.getShortTitle()).append("</a></div>");
	  	  	    		out.println(artHtml.toString());
	  	  			} 
	  	  		}
  	  	    }
  	  	%>
  	  </div>
  	</td>
  	<td width="395" valign="top">
  	  <div class="tktitle">
  	  	<s:if test="#attr.data.right != null">
	  	  <a href="${ctx}/ltcata/catalog.do?path=${data.right.rootPath}" target="_blank">${data.right.name}</a>
  	  	</s:if>
  	  </div>
  	  <div>
  	  <%
  	  	List<Articles> rights = (List<Articles>)data.get(TkConstants.RIGHT_DATAS);
  	  	  if(rights != null){
	  	  	for(Articles art : rights){
	  	  		StringBuffer artHtml = new StringBuffer();
	  	  		artHtml.append("<div class='tkart'><a target='_blank' href='../ltart/view.do?model.id=").append(art.getId()); 
	  	  		artHtml.append("' title='").append(art.getShortTitle()).append("'><b>．</b>");
	    		artHtml.append(art.getShortTitle()).append("</a></div>");
	    		out.println(artHtml.toString());
	  	  	}
  	  	  }
  	  %>
  	  </div>
  	</td>
  </tr>
</table>
<%@include file="/pages/new/index_bottom.jsp" %>
<%@include file="/pages/new/footbar.jsp" %>
</body>
</html>